Optimal. Leaf size=144 \[ \frac {8 \sqrt [4]{-1} a^3 (i A+B) \text {ArcTan}\left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right )}{d}+\frac {16 a^3 (6 A-5 i B)}{15 d \sqrt {\tan (c+d x)}}-\frac {2 a A (a+i a \tan (c+d x))^2}{5 d \tan ^{\frac {5}{2}}(c+d x)}-\frac {2 (9 i A+5 B) \left (a^3+i a^3 \tan (c+d x)\right )}{15 d \tan ^{\frac {3}{2}}(c+d x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.25, antiderivative size = 144, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {3674, 3672,
3614, 211} \begin {gather*} \frac {8 \sqrt [4]{-1} a^3 (B+i A) \text {ArcTan}\left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right )}{d}-\frac {2 (5 B+9 i A) \left (a^3+i a^3 \tan (c+d x)\right )}{15 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {16 a^3 (6 A-5 i B)}{15 d \sqrt {\tan (c+d x)}}-\frac {2 a A (a+i a \tan (c+d x))^2}{5 d \tan ^{\frac {5}{2}}(c+d x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 3614
Rule 3672
Rule 3674
Rubi steps
\begin {align*} \int \frac {(a+i a \tan (c+d x))^3 (A+B \tan (c+d x))}{\tan ^{\frac {7}{2}}(c+d x)} \, dx &=-\frac {2 a A (a+i a \tan (c+d x))^2}{5 d \tan ^{\frac {5}{2}}(c+d x)}+\frac {2}{5} \int \frac {(a+i a \tan (c+d x))^2 \left (\frac {1}{2} a (9 i A+5 B)-\frac {1}{2} a (A-5 i B) \tan (c+d x)\right )}{\tan ^{\frac {5}{2}}(c+d x)} \, dx\\ &=-\frac {2 a A (a+i a \tan (c+d x))^2}{5 d \tan ^{\frac {5}{2}}(c+d x)}-\frac {2 (9 i A+5 B) \left (a^3+i a^3 \tan (c+d x)\right )}{15 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {4}{15} \int \frac {(a+i a \tan (c+d x)) \left (-2 a^2 (6 A-5 i B)-a^2 (3 i A+5 B) \tan (c+d x)\right )}{\tan ^{\frac {3}{2}}(c+d x)} \, dx\\ &=\frac {16 a^3 (6 A-5 i B)}{15 d \sqrt {\tan (c+d x)}}-\frac {2 a A (a+i a \tan (c+d x))^2}{5 d \tan ^{\frac {5}{2}}(c+d x)}-\frac {2 (9 i A+5 B) \left (a^3+i a^3 \tan (c+d x)\right )}{15 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {4}{15} \int \frac {-15 a^3 (i A+B)+15 a^3 (A-i B) \tan (c+d x)}{\sqrt {\tan (c+d x)}} \, dx\\ &=\frac {16 a^3 (6 A-5 i B)}{15 d \sqrt {\tan (c+d x)}}-\frac {2 a A (a+i a \tan (c+d x))^2}{5 d \tan ^{\frac {5}{2}}(c+d x)}-\frac {2 (9 i A+5 B) \left (a^3+i a^3 \tan (c+d x)\right )}{15 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {\left (120 a^6 (i A+B)^2\right ) \text {Subst}\left (\int \frac {1}{-15 a^3 (i A+B)-15 a^3 (A-i B) x^2} \, dx,x,\sqrt {\tan (c+d x)}\right )}{d}\\ &=\frac {8 \sqrt [4]{-1} a^3 (i A+B) \tan ^{-1}\left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right )}{d}+\frac {16 a^3 (6 A-5 i B)}{15 d \sqrt {\tan (c+d x)}}-\frac {2 a A (a+i a \tan (c+d x))^2}{5 d \tan ^{\frac {5}{2}}(c+d x)}-\frac {2 (9 i A+5 B) \left (a^3+i a^3 \tan (c+d x)\right )}{15 d \tan ^{\frac {3}{2}}(c+d x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(449\) vs. \(2(144)=288\).
time = 7.91, size = 449, normalized size = 3.12 \begin {gather*} -\frac {8 i (A-i B) e^{-3 i c} \sqrt {-\frac {i \left (-1+e^{2 i (c+d x)}\right )}{1+e^{2 i (c+d x)}}} \tanh ^{-1}\left (\sqrt {\frac {-1+e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}}\right ) \cos ^4(c+d x) (a+i a \tan (c+d x))^3 (A+B \tan (c+d x))}{d \sqrt {\frac {-1+e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}} (\cos (d x)+i \sin (d x))^3 (A \cos (c+d x)+B \sin (c+d x))}+\frac {\cos ^4(c+d x) \left (\csc (c) (63 A \cos (c)-45 i B \cos (c)+15 i A \sin (c)+5 B \sin (c)) \left (\frac {2}{15} \cos (3 c)-\frac {2}{15} i \sin (3 c)\right )+\csc (c) \csc ^2(c+d x) (3 A \cos (c)+15 i A \sin (c)+5 B \sin (c)) \left (-\frac {2}{15} \cos (3 c)+\frac {2}{15} i \sin (3 c)\right )+A \csc (c) \csc ^3(c+d x) \left (\frac {2}{5} \cos (3 c)-\frac {2}{5} i \sin (3 c)\right ) \sin (d x)+\csc (c) \csc (c+d x) \left (-\frac {6}{5} \cos (3 c)+\frac {6}{5} i \sin (3 c)\right ) (7 A \sin (d x)-5 i B \sin (d x))\right ) \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^3 (A+B \tan (c+d x))}{d (\cos (d x)+i \sin (d x))^3 (A \cos (c+d x)+B \sin (c+d x))} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.05, size = 240, normalized size = 1.67
method | result | size |
derivativedivides | \(\frac {a^{3} \left (-\frac {2 A}{5 \tan \left (d x +c \right )^{\frac {5}{2}}}-\frac {2 \left (3 i A +B \right )}{3 \tan \left (d x +c \right )^{\frac {3}{2}}}-\frac {2 \left (3 i B -4 A \right )}{\sqrt {\tan \left (d x +c \right )}}+\frac {\left (-4 i A -4 B \right ) \sqrt {2}\, \left (\ln \left (\frac {1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}{1-\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )\right )}{4}+\frac {\left (-4 i B +4 A \right ) \sqrt {2}\, \left (\ln \left (\frac {1-\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}{1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )\right )}{4}\right )}{d}\) | \(240\) |
default | \(\frac {a^{3} \left (-\frac {2 A}{5 \tan \left (d x +c \right )^{\frac {5}{2}}}-\frac {2 \left (3 i A +B \right )}{3 \tan \left (d x +c \right )^{\frac {3}{2}}}-\frac {2 \left (3 i B -4 A \right )}{\sqrt {\tan \left (d x +c \right )}}+\frac {\left (-4 i A -4 B \right ) \sqrt {2}\, \left (\ln \left (\frac {1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}{1-\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )\right )}{4}+\frac {\left (-4 i B +4 A \right ) \sqrt {2}\, \left (\ln \left (\frac {1-\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}{1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )+\tan \left (d x +c \right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\tan }\left (d x +c \right )\right )\right )\right )}{4}\right )}{d}\) | \(240\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 197, normalized size = 1.37 \begin {gather*} -\frac {15 \, {\left (2 \, \sqrt {2} {\left (\left (i - 1\right ) \, A + \left (i + 1\right ) \, B\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + 2 \, \sqrt {\tan \left (d x + c\right )}\right )}\right ) + 2 \, \sqrt {2} {\left (\left (i - 1\right ) \, A + \left (i + 1\right ) \, B\right )} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} - 2 \, \sqrt {\tan \left (d x + c\right )}\right )}\right ) - \sqrt {2} {\left (-\left (i + 1\right ) \, A + \left (i - 1\right ) \, B\right )} \log \left (\sqrt {2} \sqrt {\tan \left (d x + c\right )} + \tan \left (d x + c\right ) + 1\right ) + \sqrt {2} {\left (-\left (i + 1\right ) \, A + \left (i - 1\right ) \, B\right )} \log \left (-\sqrt {2} \sqrt {\tan \left (d x + c\right )} + \tan \left (d x + c\right ) + 1\right )\right )} a^{3} - \frac {2 \, {\left (15 \, {\left (4 \, A - 3 i \, B\right )} a^{3} \tan \left (d x + c\right )^{2} + 5 \, {\left (-3 i \, A - B\right )} a^{3} \tan \left (d x + c\right ) - 3 \, A a^{3}\right )}}{\tan \left (d x + c\right )^{\frac {5}{2}}}}{15 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 504 vs. \(2 (116) = 232\).
time = 2.17, size = 504, normalized size = 3.50 \begin {gather*} -\frac {2 \, {\left (15 \, \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{6}}{d^{2}}} {\left (d e^{\left (6 i \, d x + 6 i \, c\right )} - 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \log \left (-\frac {2 \, {\left ({\left (A - i \, B\right )} a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{6}}{d^{2}}} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{{\left (-i \, A - B\right )} a^{3}}\right ) - 15 \, \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{6}}{d^{2}}} {\left (d e^{\left (6 i \, d x + 6 i \, c\right )} - 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \log \left (-\frac {2 \, {\left ({\left (A - i \, B\right )} a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} - \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{6}}{d^{2}}} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{{\left (-i \, A - B\right )} a^{3}}\right ) + 2 \, {\left ({\left (-39 i \, A - 25 \, B\right )} a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 2 \, {\left (9 i \, A + 10 \, B\right )} a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + {\left (33 i \, A + 25 \, B\right )} a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 4 \, {\left (-6 i \, A - 5 \, B\right )} a^{3}\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )}}{15 \, {\left (d e^{\left (6 i \, d x + 6 i \, c\right )} - 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - i a^{3} \left (\int \left (- \frac {3 A}{\tan ^{\frac {5}{2}}{\left (c + d x \right )}}\right )\, dx + \int \frac {A}{\sqrt {\tan {\left (c + d x \right )}}}\, dx + \int \left (- \frac {3 B}{\tan ^{\frac {3}{2}}{\left (c + d x \right )}}\right )\, dx + \int B \sqrt {\tan {\left (c + d x \right )}}\, dx + \int \frac {i A}{\tan ^{\frac {7}{2}}{\left (c + d x \right )}}\, dx + \int \left (- \frac {3 i A}{\tan ^{\frac {3}{2}}{\left (c + d x \right )}}\right )\, dx + \int \frac {i B}{\tan ^{\frac {5}{2}}{\left (c + d x \right )}}\, dx + \int \left (- \frac {3 i B}{\sqrt {\tan {\left (c + d x \right )}}}\right )\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.38, size = 107, normalized size = 0.74 \begin {gather*} -\frac {\left (4 i + 4\right ) \, \sqrt {2} {\left (i \, A a^{3} + B a^{3}\right )} \arctan \left (-\left (\frac {1}{2} i - \frac {1}{2}\right ) \, \sqrt {2} \sqrt {\tan \left (d x + c\right )}\right )}{d} + \frac {2 \, {\left (60 \, A a^{3} \tan \left (d x + c\right )^{2} - 45 i \, B a^{3} \tan \left (d x + c\right )^{2} - 15 i \, A a^{3} \tan \left (d x + c\right ) - 5 \, B a^{3} \tan \left (d x + c\right ) - 3 \, A a^{3}\right )}}{15 \, d \tan \left (d x + c\right )^{\frac {5}{2}}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 7.39, size = 258, normalized size = 1.79 \begin {gather*} -\frac {\frac {2\,A\,a^3}{5\,d}-\frac {8\,A\,a^3\,{\mathrm {tan}\left (c+d\,x\right )}^2}{d}+\frac {A\,a^3\,\mathrm {tan}\left (c+d\,x\right )\,2{}\mathrm {i}}{d}}{{\mathrm {tan}\left (c+d\,x\right )}^{5/2}}-\frac {\frac {2\,B\,a^3}{3\,d}+\frac {B\,a^3\,\mathrm {tan}\left (c+d\,x\right )\,6{}\mathrm {i}}{d}}{{\mathrm {tan}\left (c+d\,x\right )}^{3/2}}+\frac {\sqrt {2}\,A\,a^3\,\ln \left (8\,A\,a^3\,d+\sqrt {2}\,A\,a^3\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\left (-4-4{}\mathrm {i}\right )\right )\,\left (2+2{}\mathrm {i}\right )}{d}-\frac {\sqrt {16{}\mathrm {i}}\,A\,a^3\,\ln \left (8\,A\,a^3\,d+2\,\sqrt {16{}\mathrm {i}}\,A\,a^3\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\right )}{d}+\frac {\sqrt {2}\,B\,a^3\,\ln \left (-B\,a^3\,d\,8{}\mathrm {i}+\sqrt {2}\,B\,a^3\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\left (-4+4{}\mathrm {i}\right )\right )\,\left (2-2{}\mathrm {i}\right )}{d}-\frac {\sqrt {-16{}\mathrm {i}}\,B\,a^3\,\ln \left (-B\,a^3\,d\,8{}\mathrm {i}+2\,\sqrt {-16{}\mathrm {i}}\,B\,a^3\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________